<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>运算符</title>
</head>
<body>
<script>
    //算数运算符
    console.log(12 + 3)
    console.log(12 - 3)
    console.log(12 * 3)
    console.log(12 / 3)
    console.log(12 % 3)

    //关系运算符 ==, ===, !=, >, <, <=, >=
    let a = 12
    let b = '12'
    console.log(a == b) //数据相等     //true
    console.log(a === b) //类型也相等  //false

    //逻辑运算符 &&， ||
    console.log(true && false) //false
    console.log(true || false) //true

    //三目运算符
    let yn = 12 > 9 ? 'YES' : 'NO'
    console.log(yn) //YES

    //赋值运算
    var x = 12;
    console.log(x += 1) //13
    console.log(x -= 1) //12
    console.log(++x)  //13
    console.log(x--)  //13

    //字符串连接
    console.log("" + 12 + 12) //1212
    console.log(12 + 12 + "") //24
</script>
</body>
</html>